import request from '@/utils/request'


/*
    用户/用户管理模块----------------------------
*/
// 登录
export function login(data) {
    return request({
        url: 'login/account',
        method: 'post',
        data
    })
}

// 用户查询
export function userListPaging(data) {
    return request({
        url: 'user/userListPaging',
        method: 'post',
        data
    })
}

// 用户新增/修改
export function userAddOrUpdate(data) {
    return request({
        url: 'user/userAddOrUpdate',
        method: 'post',
        data
    })
}

// 用户删除
export function deleteById(params) {
    return request({
        url: 'user/deleteById/' + params.id,
        method: 'get',
    })
}


/*
    留言管理模块----------------------------
*/
// 回复留言
export function updateMessage(data) {
    return request({
        url: 'messageController/updateMessage',
        method: 'post',
        data
    })
}

// 留言查询
export function getMessageList(data) {
    return request({
        url: 'messageController/getMessageList',
        method: 'post',
        data
    })
}

//  留言删除
export function deleteMessageById(params) {
    return request({
        url: 'messageController/deleteMessageById/' + params.id,
        method: 'get',
    })
}


/*
    公告管理模块----------------------------
*/
// 公告查询
export function getNoticeList(data) {
    return request({
        url: 'noticeController/getNoticeList',
        method: 'post',
        data
    })
}

// 公告新建
export function addNotice(data) {
    return request({
        url: 'noticeController/addNotice',
        method: 'post',
        data
    })
}

// 公告修改
export function updateNotice(data) {
    return request({
        url: 'noticeController/updateNotice',
        method: 'post',
        data
    })
}

//  公告删除
export function deleteNoticeById(params) {
    return request({
        url: 'noticeController/deleteNoticeById/' + params.id,
        method: 'get',
    })
}


/*
    预约看房模块----------------------------
*/
// 预约查询
export function getReservationList(data) {
    return request({
        url: 'reservationController/getReservationList',
        method: 'post',
        data
    })
}

// 预约修改
export function updateReservation(data) {
    return request({
        url: 'reservationController/updateReservation',
        method: 'post',
        data
    })
}

//  预约删除
export function deleteReservationById(params) {
    return request({
        url: 'reservationController/deleteReservationById/' + params.id,
        method: 'get',
    })
}

/*
    故障报修模块----------------------------
*/
// 故障报修查询
export function getFaultList(data) {
    return request({
        url: 'faultController/getFaultList',
        method: 'post',
        data
    })
}

// 故障报修修改
export function updateFault(data) {
    return request({
        url: 'faultController/updateFault',
        method: 'post',
        data
    })
}

// 故障报修新建
export function addFault(data) {
    return request({
        url: 'faultController/addFault',
        method: 'post',
        data
    })
}

//  故障报修删除
export function deleteFaultById(params) {
    return request({
        url: 'faultController/deleteFaultById/' + params.id,
        method: 'get',
    })
}


/*
    房源模块----------------------------
*/
// 房源查询
export function getHousingResourcesInfoList(data) {
    return request({
        url: 'housingResourcesInfoController/getHousingResourcesInfoList',
        method: 'post',
        data
    })
}

// 房源修改
export function updateHousingResourcesInfo(data) {
    return request({
        url: 'housingResourcesInfoController/updateHousingResourcesInfo',
        method: 'post',
        data
    })
}

// 房源新建
export function addHousingResourcesInfo(data) {
    return request({
        url: 'housingResourcesInfoController/addHousingResourcesInfo',
        method: 'post',
        data
    })
}

//  房源删除
export function deleteHousingResourcesInfoById(params) {
    return request({
        url: 'housingResourcesInfoController/deleteHousingResourcesInfoById/' + params.id,
        method: 'get',
    })
}


/*
    租赁模块----------------------------
*/
// 租赁查询
export function getLeasingInformationList(data) {
    return request({
        url: 'leasingInformationController/getLeasingInformationList',
        method: 'post',
        data
    })
}

// 租赁修改
export function updateLeasingInformation(data) {
    return request({
        url: 'leasingInformationController/updateLeasingInformation',
        method: 'post',
        data
    })
}

// 租赁新建
export function addLeasingInformation(data) {
    return request({
        url: 'leasingInformationController/addLeasingInformation',
        method: 'post',
        data
    })
}

//  租赁删除
export function deleteLeasingInformationById(params) {
    return request({
        url: 'leasingInformationController/deleteLeasingInformationById/' + params.id,
        method: 'get',
    })
}



export default {
    login,
    userListPaging,
    userAddOrUpdate,
    deleteById,
    updateMessage,
    getMessageList,
    deleteMessageById,
    getNoticeList,
    addNotice,
    updateNotice,
    deleteNoticeById,
    getReservationList,
    updateReservation,
    deleteReservationById,
    getFaultList,
    updateFault,
    deleteFaultById,
    addFault,
    getHousingResourcesInfoList,
    updateHousingResourcesInfo,
    addHousingResourcesInfo,
    deleteHousingResourcesInfoById,
    getLeasingInformationList,
    updateLeasingInformation,
    addLeasingInformation,
    deleteLeasingInformationById
}